
package org.apache.solr.internal.csv.writer;

public class CSVField {

    private String name;
    private int size;
    private int fill;
    private boolean overrideFill;

    public CSVField() {
    }

    /**
     * @param name the name of the field
     */
    public CSVField(String name) {
        setName(name);
    }

    /**
     * @param name the name of the field
     * @param size the size of the field
     */
    public CSVField(String name, int size) {
        setName(name);
        setSize(size);
    }

    /**
     * @return the name of the field
     */
    public String getName() {
        return name;
    }

    /**
     * Set the name of the field
     *
     * @param name the name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     *
     * @return the size of the field
     */
    public int getSize() {
        return size;
    }

    /**
     * Set the size of the field. The size will be ignored when fixedwidth is
     * set to false in the CSVConfig
     *
     * @param size the size of the field.
     */
    public void setSize(int size) {
        this.size = size;
    }

    /**
     * @return the fill pattern.
     */
    public int getFill() {
        return fill;
    }

    /**
     * Sets overrideFill to true.
     *
     * @param fill the file pattern
     */
    public void setFill(int fill) {
        overrideFill = true;
        this.fill = fill;
    }

    /**
     * Does this field override fill ?
     *
     */
    public boolean overrideFill() {
        return overrideFill;
    }
}
